
<%@ page import="org.xilin.Family" %>
<g:setProvider library="jquery"/>

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta name="layout" content="main" />
        <g:set var="entityName" value="${message(code: 'family.label', default: 'Family')}" />
        <title><g:message code="default.edit.label" args="[entityName]" /></title>
    </head>
    <body>
        <div class="nav">
            <span class="menuButton"><a class="home" href="${createLink(uri: '/')}">Home</a></span>
            <span class="menuButton"><g:link class="list" action="list"><g:message code="default.list.label" args="[entityName]" /></g:link></span>
            <span class="menuButton"><g:link class="create" action="create"><g:message code="default.new.label" args="[entityName]" /></g:link></span>
        </div>
        <div class="body">
            <h1><g:message code="default.edit.label" args="[entityName]" /></h1>
            <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>
            <g:hasErrors bean="${familyInstance}">
            <div class="errors">
                <g:renderErrors bean="${familyInstance}" as="list" />
            </div>
            </g:hasErrors>
            <g:form method="post" >
                <g:hiddenField name="id" value="${familyInstance?.userId}" />
                <g:hiddenField name="version" value="${familyInstance?.version}" />
                <div class="dialog">
                    <table>
                        <tbody>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="fatherFirstName"><g:message code="family.fatherFirstName.label" default="Father First Name" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: familyInstance, field: 'fatherFirstName', 'errors')}">
                                    <g:textField name="fatherFirstName" value="${familyInstance?.fatherFirstName}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="fatherLastName"><g:message code="family.fatherLastName.label" default="Father Last Name" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: familyInstance, field: 'fatherLastName', 'errors')}">
                                    <g:textField name="fatherLastName" value="${familyInstance?.fatherLastName}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="motherFirstName"><g:message code="family.motherFirstName.label" default="Mother First Name" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: familyInstance, field: 'motherFirstName', 'errors')}">
                                    <g:textField name="motherFirstName" value="${familyInstance?.motherFirstName}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="motherLastName"><g:message code="family.motherLastName.label" default="Mother Last Name" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: familyInstance, field: 'motherLastName', 'errors')}">
                                    <g:textField name="motherLastName" value="${familyInstance?.motherLastName}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="address"><g:message code="family.address.label" default="Address" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: familyInstance, field: 'address', 'errors')}">
                                    <g:textField name="address" value="${familyInstance?.address}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="city"><g:message code="family.city.label" default="City" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: familyInstance, field: 'city', 'errors')}">
                                    <g:textField name="city" value="${familyInstance?.city}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="state"><g:message code="family.state.label" default="State" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: familyInstance, field: 'state', 'errors')}">
                                    <g:textField name="state" value="${familyInstance?.state}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="zipCode"><g:message code="family.zipCode.label" default="Zip Code" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: familyInstance, field: 'zipCode', 'errors')}">
                                    <g:textField name="zipCode" value="${familyInstance?.zipCode}" />
                                </td>
                            </tr>
                       
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="homeTel_3"><g:message code="family.homeTel_3.label" default="Home Tel3" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: familyInstance, field: 'homeTel_3', 'errors')}">
                                    <g:textField name="homeTel_3" value="${familyInstance?.homeTel_3}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="fatherChineseName"><g:message code="family.fatherChineseName.label" default="Father Chinese Name" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: familyInstance, field: 'fatherChineseName', 'errors')}">
                                    <g:textField name="fatherChineseName" value="${familyInstance?.fatherChineseName}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="homeTel_1"><g:message code="family.homeTel_1.label" default="Home Tel1" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: familyInstance, field: 'homeTel_1', 'errors')}">
                                    <g:textField name="homeTel_1" value="${familyInstance?.homeTel_1}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="homeTel_2"><g:message code="family.homeTel_2.label" default="Home Tel2" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: familyInstance, field: 'homeTel_2', 'errors')}">
                                    <g:textField name="homeTel_2" value="${familyInstance?.homeTel_2}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="userId"><g:message code="family.userId.label" default="Family Id" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: familyInstance, field: 'userId', 'errors')}">
                                    <g:textField name="userId" value="${fieldValue(bean: familyInstance, field: 'userId')}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="students"><g:message code="family.students.label" default="Students" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: familyInstance, field: 'students', 'errors')}">
                                    
<ul>
<g:each in="${familyInstance?.students?}" var="s">
    <li><g:link controller="student" action="show" id="${s.id}">${s?.encodeAsHTML()}</g:link></li>
</g:each>
</ul>
<g:link controller="student" action="create" params="['family.id': familyInstance?.id]">${message(code: 'default.add.label', args: [message(code: 'student.label', default: 'Student')])}</g:link>

                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="workTel_ext"><g:message code="family.workTel_ext.label" default="Work Telext" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: familyInstance, field: 'workTel_ext', 'errors')}">
                                    <g:textField name="workTel_ext" value="${familyInstance?.workTel_ext}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="motherChineseName"><g:message code="family.motherChineseName.label" default="Mother Chinese Name" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: familyInstance, field: 'motherChineseName', 'errors')}">
                                    <g:textField name="motherChineseName" value="${familyInstance?.motherChineseName}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="workTel_1"><g:message code="family.workTel_1.label" default="Work Tel1" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: familyInstance, field: 'workTel_1', 'errors')}">
                                    <g:textField name="workTel_1" value="${familyInstance?.workTel_1}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="workTel_2"><g:message code="family.workTel_2.label" default="Work Tel2" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: familyInstance, field: 'workTel_2', 'errors')}">
                                    <g:textField name="workTel_2" value="${familyInstance?.workTel_2}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="workTel_3"><g:message code="family.workTel_3.label" default="Work Tel3" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: familyInstance, field: 'workTel_3', 'errors')}">
                                    <g:textField name="workTel_3" value="${familyInstance?.workTel_3}" />
                                </td>
                            </tr>                        
                        </tbody>
                    </table>
                </div>
                <div class="buttons">
                    <span class="button"><g:actionSubmit class="save" action="update" value="${message(code: 'default.button.update.label', default: 'Update')}" /></span>
                    <span class="button"><g:actionSubmit class="delete" action="delete" value="${message(code: 'default.button.delete.label', default: 'Delete')}" onclick="return confirm('${message(code: 'default.button.delete.confirm.message', default: 'Are you sure?')}');" /></span>
                </div>
            </g:form>
        </div>
    </body>
</html>
